package com.evil.application.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evil.application.pojo.dto.button.ButtonInfoRespDTO;
import com.evil.application.pojo.dto.button.CopyButtonReqDTO;
import com.evil.application.pojo.dto.button.ModifyButtonsReqDTO;
import com.evil.application.pojo.entity.ApplicationButton;
import com.evil.application.pojo.entity.ApplicationInfo;
import com.evil.common.application.dto.button.ButtonSourceDTO;
import org.springframework.validation.annotation.Validated;

import java.util.List;
import java.util.Map;

/**
 * 自定义按钮表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
public interface ApplicationButtonService extends IService<ApplicationButton> {

    /**
     * 按钮列表
     *
     * @param buttonSourceDTO buttonSourceDTO
     */
    List<ButtonInfoRespDTO> findBySource(ButtonSourceDTO buttonSourceDTO);

    /**
     * 保存按钮
     *
     * @param modifyButtonsReqDTO modifyButtonsReqDTO
     */
    void saveButtons(@Validated ModifyButtonsReqDTO modifyButtonsReqDTO);

    /**
     * 发布自定义按钮
     *
     * @param applicationInfo applicationInfo
     * @param controlIdMap    controlIdMap
     */
    void publishButton(ApplicationInfo applicationInfo, Map<Long, Long> controlIdMap);

    /**
     * 还原自定义按钮
     *
     * @param applicationInfo applicationInfo
     * @param controlIdMap    controlIdMap
     */
    void restoreButton(ApplicationInfo applicationInfo, Map<Long, Long> controlIdMap);

    /**
     * 复制按钮
     *
     * @param copyButtonReqDTO copyButtonReqDTO
     */
    void copyButton(CopyButtonReqDTO copyButtonReqDTO);

    /**
     * 应用按钮信息
     *
     * @param buttons buttons
     * @return List
     */
    List<ButtonInfoRespDTO> perfectButtonInfo(List<ApplicationButton> buttons);

}
